package com.yp.lession01.entity;


import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zoro
 * @create 2022-03-11 21:48
 */
@Component
public class Entry implements Serializable {
    private int eId;
    private int cId;
    private String eTitle;
    private String eSummary;
    private String eUploadUser;
    @DateTimeFormat(pattern = "yyyy-MM-dd")

    private Date eCreateDate;

    @Override
    public String toString() {
        return "Entry{" +
                "eId=" + eId +
                ", cId=" + cId +
                ", eTitle='" + eTitle + '\'' +
                ", eSummary='" + eSummary + '\'' +
                ", eUploadUser='" + eUploadUser + '\'' +
                ", eCreateDate=" + eCreateDate +
                ", category=" + category +
                '}';
    }

    private Category category;

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Entry(int eId, int cId, String eTitle, String eSummary, String eUploadUser, Date eCreateDate, Category category) {
        this.eId = eId;
        this.cId = cId;
        this.eTitle = eTitle;
        this.eSummary = eSummary;
        this.eUploadUser = eUploadUser;
        this.eCreateDate = eCreateDate;
        this.category = category;
    }

    public Entry(int eId, int cId, String eTitle, String eSummary, String eUploadUser, Date eCreateDate) {
        this.eId = eId;
        this.cId = cId;
        this.eTitle = eTitle;
        this.eSummary = eSummary;
        this.eUploadUser = eUploadUser;
        this.eCreateDate = eCreateDate;
    }

    public Entry() {
    }

    public int geteId() {
        return eId;
    }

    public void seteId(int eId) {
        this.eId = eId;
    }

    public int getcId() {
        return cId;
    }

    public void setcId(int cId) {
        this.cId = cId;
    }

    public String geteTitle() {
        return eTitle;
    }

    public void seteTitle(String eTitle) {
        this.eTitle = eTitle;
    }

    public String geteSummary() {
        return eSummary;
    }

    public void seteSummary(String eSummary) {
        this.eSummary = eSummary;
    }

    public String geteUploadUser() {
        return eUploadUser;
    }

    public void seteUploadUser(String eUploadUser) {
        this.eUploadUser = eUploadUser;
    }

    public Date geteCreateDate() {
        return eCreateDate;
    }

    public void seteCreateDate(Date eCreateDate) {
        this.eCreateDate = eCreateDate;
    }
}
